package com.neuedu.his.controller;

import com.neuedu.his.mapper.RegisterMapper;
import com.neuedu.his.po.Register;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/doctor/patients")
public class DoctorPatientController {

    @Autowired
    private RegisterMapper registerMapper; // 自动注入mapper实例

    @GetMapping("/pending")
    public List<Register> getPendingPatients(@RequestHeader("doctorId") Integer doctorId) {
        // 通过实例调用方法，而不是直接通过接口调用
        return registerMapper.getPendingPatients(doctorId);
    }
}